home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
windows
/
epmpal.zip
/
EPMPAL.CMD
next >
Wrap
OS/2 REXX Batch file
|
1997-05-26
|
2KB
|
64 lines
/* í«í¿¬ßß */
call rxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
'@echo off'
patchmod = 'etke603.dll';
palfname = 'vp.pal';
signature = 'GpiCreatePS failed';
say 'This program requires lxLite to be on your path.'
say 'Second requirement is that 'patchmod' must be present'
say 'in current directory. If any of these requirements are'
say 'not meet, press Ctrl+C and fix the situation.'
call charout ,'Press any key to continue...'
call SysGetKey "noecho"
call charout ,d2c(13);
call SysFileDelete(palfname);
'start /fs /dos /c vp.com /m /s /w'
call charout ,'Waiting for palette file, press Ctrl+C to interrupt ';
do until stream(palfname, 'C', 'QUERY EXIST') <> ''
call charout ,'.';
call SysSleep 1;
end;
say '';
/* Read palette converting it from RGB format into BGR0 */
pal = '';
do i = 1 to 16
tmp = charin(palfname,,3);
do j = 3 to 1 by -1
pal = pal||d2c(c2d(substr(tmp, j, 1)) * 4 + 3);
end;
pal = pal||d2c(0);
end;
'lxLite /x 'patchmod;
if (rc <> 0)
then do
say 'lxLite failed to unpack 'patchmod
say 'Please check that you'
say 'a) Have lxLite on your PATH'
say 'b) Have 'patchmod' in current directory'
exit;
end;
say 'Applying palette to 'patchmod'...';
len = chars(patchmod);
mod = charin(patchmod,,len);
pp = pos(signature, mod);
if pp = 0
then do
say 'Signature not found - seems that you have a different EPM version'
exit;
end;
mod = overlay(pal, mod, pp - length(pal));
call stream patchmod, 'C', 'CLOSE';
'del 'patchmod
call charout patchmod, mod
call stream patchmod, 'C', 'CLOSE';
'lxLite 'patchmod;
say 'Palette applied successfully'